package com.michaelliu.study.viewpager2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.michael.study.library.utils.Actions
import com.michaelliu.study.viewpager2.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity(), View.OnClickListener {

    private lateinit var mBinding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(mBinding.root)
        mBinding.btnVerticalViewpager.setOnClickListener(this)
        mBinding.btnTab.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when(v?.id) {

            R.id.btn_vertical_viewpager->{
                Actions.startActivity(this,VerticalViewPagerActivity::class.java)
            }

            R.id.btn_tab -> {
                Actions.startActivity(this,TabActivity::class.java)
            }
        }
    }
}
